package com.taldh.design.patterns.chain.impl;

/**
 * date 2020/6/4
 *
 * @author 袁小黑
 * @version 1.0.0
 **/

public class Boss  {

    SaleManager saleManager;

    public Boss() {
        saleManager = new SaleManager(new SaleGrouper(new Saler(null)));
    }

    public void saleHouse(Request request) {
        if (request.getHouseNum() > 20) {
            System.out.println("客人要"+request.getHouseNum()+"套房子，"+this.toString()+"快出来招待客人！");
        } else {
            saleManager.saleHouse(request);
        }
    }

    @Override
    public String toString() {
        return "老板";
    }
}
